package com.google.android.gms.internal;

import java.io.IOException;

public final class zzjf extends zzflm<zzjf> {
    private String zzatx = null;
    private zzje[] zzbdj = zzje.zzhv();
    private Integer zzbdk = null;

    public zzjf() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzi */
    public final zzjf zza(zzflj zzflj) throws IOException {
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx == 10) {
                this.zzatx = zzflj.readString();
            } else if (zzcxx == 18) {
                int zzb = zzflv.zzb(zzflj, 18);
                int length = this.zzbdj == null ? 0 : this.zzbdj.length;
                zzje[] zzjeArr = new zzje[(zzb + length)];
                if (length != 0) {
                    System.arraycopy(this.zzbdj, 0, zzjeArr, 0, length);
                }
                while (length < zzjeArr.length - 1) {
                    zzjeArr[length] = new zzje();
                    zzflj.zza(zzjeArr[length]);
                    zzflj.zzcxx();
                    length++;
                }
                zzjeArr[length] = new zzje();
                zzflj.zza(zzjeArr[length]);
                this.zzbdj = zzjeArr;
            } else if (zzcxx == 24) {
                int position = zzflj.getPosition();
                try {
                    this.zzbdk = Integer.valueOf(zzjc.zzd(zzflj.zzcym()));
                } catch (IllegalArgumentException unused) {
                    zzflj.zzmw(position);
                    zza(zzflj, zzcxx);
                }
            } else if (!super.zza(zzflj, zzcxx)) {
                return this;
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzatx != null) {
            zzflk.zzp(1, this.zzatx);
        }
        if (this.zzbdj != null && this.zzbdj.length > 0) {
            for (zzje zzje : this.zzbdj) {
                if (zzje != null) {
                    zzflk.zza(2, (zzfls) zzje);
                }
            }
        }
        if (this.zzbdk != null) {
            zzflk.zzad(3, this.zzbdk.intValue());
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzatx != null) {
            zzq += zzflk.zzq(1, this.zzatx);
        }
        if (this.zzbdj != null && this.zzbdj.length > 0) {
            for (zzje zzje : this.zzbdj) {
                if (zzje != null) {
                    zzq += zzflk.zzb(2, (zzfls) zzje);
                }
            }
        }
        return this.zzbdk != null ? zzq + zzflk.zzag(3, this.zzbdk.intValue()) : zzq;
    }
}
